from django.contrib import admin
from django.conf.urls.defaults import patterns, include, url

# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
import settings

admin.autodiscover()

urlpatterns = patterns('',
    # Examples:
    # url(r'^$', 'live_engine.views.home', name='home'),
    # url(r'^live_engine/', include('live_engine.foo.urls')),

    # Uncomment the admin/doc line below to enable admin documentation:
    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # custom admin for news
    url(r'^admin/run_parser/$', "core.views.admin.run_parser"),
    url(r'^admin/news/record/preview/$', 'apps.news.views.admin.preview'),
    url(r'^admin/news/record/add/$', 'apps.news.views.admin.edit'),
    url(r'^admin/news/record/(?P<pk>[0-9]+)/$', 'apps.news.views.admin.edit'),
    # Uncomment the next line to enable the admin:
    url(r'^admin/', include(admin.site.urls)),
    url(r'^admin/files/upload/', "core.views.admin.file_upload"),
    url(r'^admin/files/list/', "core.views.admin.files_list"),
    url(r'^admin/files/list/(?P<record_pk>[0-9]+)/', "core.views.admin.files_list"),
    url(r'^admin/files/delete/', "core.views.admin.files_delete"),
    url(r'^sitemap.xml', "core.views.base.sitemap"),
    url(r'', include('apps.users.urls')),
    url(r'', include('apps.news.urls')),
    url(r'', include('apps.comments.urls')),
    url(r'', include('apps.vkontakte.urls')),
    # sitestatic for robots
    url(r'6b102a7f0a88493bffb317e6f5e047a2.txt$', "core.views.base.payclick"),
    url(r'rules.html$', "core.views.base.rules")
)

if settings.DEBUG:
    urlpatterns += patterns('',
        url(r'^uploads/(?P<path>.*)$', 'django.views.static.serve', {
            'document_root': "%s/uploads/" % settings.ROOT,
            }),
    )
